export interface Word {
  id: string;
  english: string;
  chinese: string;
  category: string;
  definition?: string;
  isCustom?: boolean;
}

export type Category = string;

export const defaultCategories = ['全部类别', '日常生活', '商务职场', '学术教育', '旅游出行', '科技数码'] as const;

export type GameMode = 'matching' | 'spelling' | 'quiz';

export type Difficulty = 'easy' | 'medium' | 'hard';

export interface GameSettings {
  difficulty: Difficulty;
  timeLimit: number;
  soundEnabled: boolean;
}

export interface GameResult {
  score: number;
  correctCount: number;
  wrongCount: number;
  totalTime?: number;
  accuracy?: number;
  wrongWords?: Word[];
}

export interface GameStats {
  matching: {
    totalGames: number;
    totalTime: number;
    averageTime: number;
    bestTime: number;
  };
  spelling: {
    totalGames: number;
    totalWords: number;
    correctWords: number;
    accuracy: number;
  };
  quiz: {
    totalGames: number;
    totalScore: number;
    averageScore: number;
    bestScore: number;
    accuracy: number;
  };
}

export interface CategoryStats {
  [category: string]: {
    attempted: number;
    correct: number;
    accuracy: number;
  };
}

export interface Pet {
  id: string;
  name: string;
  level: number;
  experience: number;
  maxExperience: number;
  image: string;
  isUnlocked: boolean;
  description: string;
}

export interface Achievement {
  id: string;
  title: string;
  description: string;
  icon: string;
  isUnlocked: boolean;
  progress: number;
  maxProgress: number;
  category: 'words' | 'games' | 'streak' | 'special';
}

export interface UserProgress {
  totalWordsLearned: number;
  totalExperience: number;
  availableExperience: number;
  currentStreak: number;
  longestStreak: number;
  lastStudyDate: string;
}
